import request from '@/utils/request'

// 查询仓库列表
export function listBizWarehouse (query) {
  return request({
    url: '/biz/bizWarehouse/list',
    method: 'get',
    params: query
  })
}

// 查询仓库详细
export function getBizWarehouse (id) {
  return request({
    url: '/biz/bizWarehouse/' + id,
    method: 'get'
  })
}

// 新增仓库
export function addBizWarehouse (data) {
  return request({
    url: '/biz/bizWarehouse',
    method: 'post',
    data: data
  })
}

// 修改仓库
export function updateBizWarehouse (data) {
  return request({
    url: '/biz/bizWarehouse',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function delBizWarehouse (id) {
  return request({
    url: '/biz/bizWarehouse/' + id,
    method: 'delete'
  })
}


// 导出仓库
export function exportBizWarehouse (query) {
  return request({
    url: '/biz/bizWarehouse/export',
    method: 'get',
    params: query
  })
}

// 获取初始化数据
export function getInitData (dictTypes) {
  return request({
    url: '/biz/bizWarehouse/getInitData/' + dictTypes,
    method: 'get'
  })
}

// 查询仓库列表
export function allListBizWarehouse () {
  return request({
    url: '/biz/bizWarehouse/allList',
    method: 'get'
  })
}
// 根据产品id查询仓库列表
export function allListBizWarehouseByProductId (productId) {
  return request({
    url: `/biz/bizWarehouse/allListByProductId/${productId}`,
    method: 'get'
  })
}
